<?php
class Admin_Form_CreateNews extends Zend_Form{
	
	public function init()
	{
		$model = new Admin_Model_Category();
    	$categories = $model->getCategoryList()->toArray();
    	
		$id = new Zend_Form_Element_Hidden('contentId');
		
    	$categoryList = new Zend_Form_Element_Select('category');
    	$categoryList->setLabel('Category:');
    	foreach ($categories as $id=>$category)
    		$categoryList->addMultiOption($category['categoryId'],$category['categoryName']);
    		
    	$HeadLine = new Zend_Form_Element_Text('title');
		$HeadLine->setLabel('Title:')
				->setRequired(true);
				
		$image = new Zend_Form_Element_File('image');
		$image->setLabel('Select an Image');
		
		$Description = new Zend_Form_Element_Text('summary');
		$Description->setLabel('Description:')
					->setRequired(true);
					
		$Content = new Zend_Form_Element_Textarea('body');
		$Content->setLabel('Content:')
				->setRequired('true');
				
		$submit = new Zend_Form_Element_Submit('post');
		$submit->setLabel('Post');
    			
    	$this->addElements(array($id,$HeadLine,$categoryList,$image,$Description,$Content,$submit));
	}
}

